/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pig.mt.service;

import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.mt.entity.WxInfo;
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
import me.chanjar.weixin.mp.bean.result.WxMpUser;

/**
 * 
 *
 * @author JLM
 * @date 2021-03-05 11:45:08
 */
public interface WxInfoService extends IService<WxInfo> {
	R<?> appLoginByCode(String appid, String code);

	WxOAuth2UserInfo getWxUserInfo(String appid, String code);

	WxOAuth2UserInfo getWxUserInfoByAk(String appid, String openId, String wxAk);

	void bindAppAppid(String userId, WxOAuth2UserInfo userInfo);

	void unbindAppAppid(Long userId);

	void bindMpAppid(WxMpUser userWxInfo);

	void unbindMpAppid(String openId);

	WxInfo getInfoFromWpAppId(String openId);

	R<?> waLoginByCode(String appid, String code);

	void bindMaAppid(String userId, WxMaUserInfo userInfo);

	R<?> unbindMaAppid(String appid, Long userId, String code);
}
